import { defineConfig } from "vite";

export default defineConfig({
  server: {
    host: "0.0.0.0",
    hmr: true,
  },
  build: {
    minify: 'esbuild', // 使用 Terser 进行压缩，默认是 'esbuild' 或 'terser'
    rollupOptions: {
      external: ["dayjs"],
      output: {
        globals: {
          dayjs: "dayjs",
        },
      },
    },
    lib: {
      entry: "./lib/index.ts",
      name: "xyfJs",
       fileName: (format) => `xyf-js.${format}.js`
    },
  },
});
